/**
 * 历史记录查看对话框
 * @param targetTable 单据名称
 * @param targetId 单据ID
 * zhangnf 20151009
 */
var historyCtrl  = new XFApp.client();
XFApp.client.prototype.history = {
		getData : function(targetTable,targetId){
			$.ajax({
			    url:basePath+"/userCenter/log/getList",
			    data:{targetTable:targetTable,targetId:targetId},  
			    type:'post',  
			    cache:false,  
			    dataType:'json',  
			    success:function(data) {
			    	if(true == data.isSuccess){
			    		data = data.result;
			    		var html = '<div class="" style="width:600px;height:200px; overflow-y:auto;">';
						html += '<table class="table table-bordered"><tr>'
							+ '<th width="56px">报文名称</th>'
							+ '<th width="35px">状态</th>'
							+ '<th width="60px">数据类型</th>'
							+ '<th width="81px">内容</th>'
							+ '<th width="42px">备注</th>'
							+ '<th width="90px">报文时间</th>'
							+ '</tr>';
						for(var index in data){
							html += '<tr>'
								+ '<td>'
								+ data[index].action
								+ '</td>'
								+ '<td>'
								+ "".getString(data[index].contentInfo)
								+ '</td>'
								+ '<td title="'+data[index].computerName+'">'
								+"".subString(data[index].computerName,5)
								+ '</td>'
								+ '<td title="'+data[index].content+'">'
								+ "".subString(data[index].content,8)
								+ '</td>'
								+ '<td title="'+data[index].loginName+'">'
								+ "".subString(data[index].loginName,5)
								+ '</td>'
								+ '<td>'
								+ data[index].actionTime
								+ '</td>'
								+ '</tr>';
						}
						html += '</table></div></div>'
						webAlert({
							title: '操作历史 ',
				            content:html
				            });
			    	}
			     },  
			     error : function() {
			    	 webAlert({
			              title:'提示',
			              content:'操作失败!',
			              opacity:.5,
			              bg:"gray",
			              width:310,
			              height:10,
			              button:[
			                      {
			                      name:"关闭",
			                      callback:function(){
			                    	  return true;
			                      }
			                      }]
			              });
			     }  
			});
			
		}
}